/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
 */

package com.jinhe.tss.cms.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.jinhe.tss.core.persistence.IEntity;
import com.jinhe.tss.core.web.dispaly.grid.GridAttributesMap;
import com.jinhe.tss.core.web.dispaly.grid.IGridNode;

/**
 * 文章评分
 */
@Entity
@Table(name = "cms_article_score")
@SequenceGenerator(name = "ArticleScore_sequence", sequenceName = "ArticleScore_sequence", initialValue = 1, allocationSize = 1)
public class ArticleScore implements IEntity, IGridNode {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "ArticleScore_sequence")
    private Long id;            // 序列
    
	private Long articleId;     // 文章ID
	private Integer score;      // 评分
	private Date scoreTime;     // 评分日期
 
	public Long getId() {
		return id;
	}
 
	public void setId(Long id) {
		this.id = id;
	}
 
	public Date getScoreTime() {
		return scoreTime;
	}
 
	public void setScoreTime(Date scoreTime) {
		this.scoreTime = scoreTime;
	}
 
	public Long getArticleId() {
		return articleId;
	}
 
	public void setArticleId(Long articleId) {
		this.articleId = articleId;
	}
 
	public Integer getScore() {
		return score;
	}
 
	public void setScore(Integer score) {
		this.score = score;
	}
    
    @Transient private String author;       // 文章作者
    @Transient private String name;         // 名称
    @Transient private String hitCount;     // 点击率
    @Transient private String averageScore; // 平均分
    @Transient private String scoreCount;   // 评分次数
    @Transient private String articleCount; // 文章数量
    @Transient private String percent;      // 百分比

    public String getPercent() {
        return percent;
    }
    public void setPercent(String percent) {
        this.percent = percent;
    }
    public String getArticleCount() {
        return articleCount;
    }
    public void setArticleCount(String articleCount) {
        this.articleCount = articleCount;
    }
 
	public String getAuthor() {
		return author;
	}
 
	public void setAuthor(String author) {
		this.author = author;
	}
 
	public String getAverageScore() {
		return averageScore;
	}
 
	public void setAverageScore(String averageScore) {
		this.averageScore = averageScore;
	}
 
	public String getHitCount() {
		return hitCount;
	}
 
	public void setHitCount(String hitCount) {
		this.hitCount = hitCount;
	}
 
	public String getName() {
		return name;
	}
 
	public void setName(String name) {
		this.name = name;
	}
 
	public String getScoreCount() {
		return scoreCount;
	}
 
	public void setScoreCount(String scoreCount) {
		this.scoreCount = scoreCount;
	}
    
	public GridAttributesMap getAttributes(GridAttributesMap map) {
		map.put("author", author);
		map.put("name", name);
		map.put("hitCount", hitCount);
		map.put("averageScore", averageScore);
		map.put("scoreCount", scoreCount);
		map.put("articleCount", articleCount);
		map.put("percent", percent);
		map.put("score", score);
		return map;
	}
}